﻿using Autofac;
using Castle.DynamicProxy;

namespace LiuQiuRong.Chat.Infrastructures.Modules
{
    /// <summary>
    /// 拦截器批量注册模块
    /// </summary>
    public partial class InterceptorModule : Module
    {
        protected override void Load(ContainerBuilder builder)
        {
            builder.RegisterAssemblyTypes(Initialize.ReferencedAssemblies).PublicOnly()
                .Where(type => !type.IsAbstract && typeof(IInterceptor).IsAssignableFrom(type));    // 注册所有实现IInterceptor接口的拦截器
        }
    }
}
